# Python 2.6.4
# Project Euler, Problem 114
# Copyright 2010 Talha Zaman

memo = dict()
def fill(size, tiles): 
    if tiles<size: return 1
    if tiles==size: return 2
    if memo.has_key((size,tiles)): return memo[(size,tiles)]
    ways = 1
    for s in xrange(size, tiles+1):
        for p in xrange(0, tiles-s+1):
            ways += fill(size, tiles-(s+p+1))
    memo[(size,tiles)] = ways
    return ways

print fill(3,50)
